package com.supply;


import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;

/**
 * @author : wushikai
 * <p>
 * date : 2021/8/7
 */
public class CallJar {

    public static void main(String[] args) throws MalformedURLException, ClassNotFoundException, IllegalAccessException, InstantiationException {




        URL url = new URL("file:/home/kia/d/java/codeLibrary/javaSE/advanced_technology/jar_mechanism/target/jar_mechanism-1.0-SNAPSHOT.jar");
        URLClassLoader myClassLoader1 = new URLClassLoader(new URL[] { url }, Thread.currentThread().getContextClassLoader());
        Class<?> clazz = myClassLoader1.loadClass("com.sky.Calc");
        System.out.println(clazz.getCanonicalName());



    }


}
